<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Scatter chart with different marker shapes</title>

    <link href="../../assets/styles.css" rel="stylesheet" />

    <style>
      
        #chart {
      max-width: 700px;
      margin: 35px auto;
    }
      
    </style>

    <script>
      window.Promise ||
        document.write(
          '<script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"><\/script>'
        )
      window.Promise ||
        document.write(
          '<script src="https://cdn.jsdelivr.net/npm/eligrey-classlist-js-polyfill@1.2.20171210/classList.min.js"><\/script>'
        )
      window.Promise ||
        document.write(
          '<script src="https://cdn.jsdelivr.net/npm/findindex_polyfill_mdn"><\/script>'
        )
    </script>

    
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js"></script>
    <script src="../../../dist/apexcharts.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-apexcharts"></script>
    

    <script>
      // Replace Math.random() with a pseudo-random number generator to get reproducible results in e2e tests
      // Based on https://gist.github.com/blixt/f17b47c62508be59987b
      var _seed = 42;
      Math.random = function() {
        _seed = _seed * 16807 % 2147483647;
        return (_seed - 1) / 2147483646;
      };
    </script>

    <script>
  /*
  // this function will generate output in this format
  // data = [
      [timestamp, 23],
      [timestamp, 33],
      [timestamp, 12]
      ...
  ]
  */
  function generateDayWiseTimeSeries(baseval, count, yrange) {
    var i = 0;
    var series = [];
    while (i < count) {
      var y = Math.floor(Math.random() * (yrange.max - yrange.min + 1)) + yrange.min;
  
      series.push([baseval, y]);
      baseval += 86400000;
      i++;
    }
    return series;
  }
  </script>
  </head>

  <body>
    
    <div id="app">
      <div id="chart">
      <apexchart type="scatter" height="350" :options="chartOptions" :series="series"></apexchart>
    </div>
    </div>

    <!-- Below element is just for displaying source code. it is not required. DO NOT USE -->
    <div id="html">
      &lt;div id=&quot;chart&quot;&gt;
        &lt;apexchart type=&quot;scatter&quot; height=&quot;350&quot; :options=&quot;chartOptions&quot; :series=&quot;series&quot;&gt;&lt;/apexchart&gt;
      &lt;/div&gt;
    </div>

    <script>
      new Vue({
        el: '#app',
        components: {
          apexchart: VueApexCharts,
        },
        data: {
          
          series: [
            {
              name: 'DIAMOND',
              data: generateDayWiseTimeSeries(
                new Date('01 Feb 2017 GMT').getTime(),
                10,
                {
                  min: 5,
                  max: 60,
                }
              ),
            },
            {
              name: 'TRIANGLE',
              data: generateDayWiseTimeSeries(
                new Date('11 Feb 2017 GMT').getTime(),
                10,
                {
                  min: 54,
                  max: 90,
                }
              ),
            },
            {
              name: 'CROSS',
              data: generateDayWiseTimeSeries(
                new Date('20 Feb 2017 GMT').getTime(),
                8,
                {
                  min: 10,
                  max: 50,
                }
              ),
            },
            {
              name: 'PLUS',
              data: generateDayWiseTimeSeries(
                new Date('28 Feb 2017 GMT').getTime(),
                16,
                {
                  min: 30,
                  max: 99,
                }
              ),
            },
          
            {
              name: 'SQUARE',
              data: generateDayWiseTimeSeries(
                new Date('20 Mar 2017 GMT').getTime(),
                10,
                {
                  min: 0,
                  max: 59,
                }
              ),
            },
            {
              name: 'LINE',
              data: generateDayWiseTimeSeries(
                new Date('29 Mar 2017 GMT').getTime(),
                10,
                {
                  min: 0,
                  max: 90,
                }
              ),
            },
            {
              name: 'CIRCLE',
              data: generateDayWiseTimeSeries(
                new Date('10 Apr 2017 GMT').getTime(),
                10,
                {
                  min: 5,
                  max: 35,
                }
              ),
            },
          
            {
              name: 'STAR',
              data: generateDayWiseTimeSeries(
                new Date('20 Apr 2017 GMT').getTime(),
                10,
                {
                  min: 15,
                  max: 60,
                }
              ),
            },
            {
              name: 'SPARKLE',
              data: generateDayWiseTimeSeries(
                new Date('29 Apr 2017 GMT').getTime(),
                10,
                {
                  min: 45,
                  max: 99,
                }
              ),
            },
          ],
          chartOptions: {
            chart: {
              height: 350,
              type: 'scatter',
              zoom: {
                type: 'xy',
              },
            },
            colors: [
              '#FF5733',
              '#33FF57',
              '#3357FF',
              '#FF33A1',
              '#33FFF6', 
              '#1E90FF', 
              '#FFFF33',
              '#A133FF',
              '#FF9933',
              '#FF3388',
            ],
            dataLabels: {
              enabled: false,
            },
            grid: {
              xaxis: {
                lines: {
                  show: true,
                },
              },
              yaxis: {
                lines: {
                  show: true,
                },
              },
            },
            xaxis: {
              type: 'datetime',
            },
            yaxis: {},
            legend: {
              markers: {
                strokeWidth: [1, 1, 3, 3, 1, 4, 1, 1, 1],
              },
            },
            markers: {
              shape: [
                'diamond',
                'triangle',
                'cross',
                'plus',
                'square',
                'line',
                'circle',
                'star',
                'sparkle',
              ],
              size: 10,
              fillOpacity: 0.8,
              strokeColors: '#333',
              strokeWidth: [1, 1, 3, 3, 1, 4, 1, 1, 1],
            },
            tooltip: {
              shared: true,
              intersect: false
            },
          },
          
          
        },
        
      })
    </script>
    
  </body>
</html>
